package com.zb.Service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zb.Service.RoomorderService;
import com.zb.entity.Roomorder;
import com.zb.mapper.RoomorderMapper;


@Component("RoomorderService")
public class RoomorderServiceImpl implements RoomorderService{
	@Autowired
	private RoomorderMapper rm;
	public void saveRoomorderMapper(Roomorder r) {
		rm.saveRoomorderMapper(r);
	}
	public List<Roomorder> getRoomorderok(String username, String roomname,
			Integer dicid, String start, String end) {
		Map<String, Object> params = new HashMap<String, Object>();
		if(username!=null&&!"".equals(username)){
			params.put("username", username);
		}
		if(roomname!=null&&!"".equals(roomname)){
			params.put("roomname", roomname);
		}
		if(dicid!=null&&!"".equals(dicid)){
			params.put("dicid", dicid);
		}
		if(start!=null&&!"".equals(start)){
			params.put("start", start);
		}
		if(end!=null&&!"".equals(end)){
			params.put("end", end);
		}
		return rm.getRoomorderok(params);
	}
	public void deleteRoomOrder(int id) {
		rm.deleteRoomOrder(id);
	}

}